﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using CPPEI.Coolzon.Event.Core;
using CPPEI.Coolzon.Event.NCL;
using CPPEI.Coolzon.Event.UI;
using CPPEI.Coolzon.UI;
using CPPEI.Coolzon.UI.Data;

namespace CPPEI.Coolzon.Theme.Fashion.MainViewControl
{
    public partial class ZoomView
    {
        [Common.Subscribe]
        public void OnOpened(CoreOpenSceneCompletedEvent @event)
        {
            this.Dispatcher.Invoke(() =>
            {
                if (@event.SwitchMode == SwitchMode.Pop)
                {
                    this.IsEnabled = false;
                }
                else if (@event.SwitchMode == SwitchMode.Replace)
                {
                    this.IsEnabled = true;
                }
                if (_interactiveType == UIInteractiveType.ShowMagnifier)
                {
                    UIEventBus.Publish(new UIShowMagnifierEvent(false));
                    ShowMagnifier(false);
                }
                else if (_interactiveType == UIInteractiveType.ShowLaserPoint)
                {
                    UIEventBus.Publish(new UIShowLaserPointEvent(false));
                    ShowPen(false);
                }
            });
        }
    }
}
